﻿<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=1600, initial-scale=1.0">
    <link rel="stylesheet" href="icofont/css/all.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/user.css">
    <link rel="shortcut icon" href="images/favicon.ico">
    <title>查看问卷</title>
</head>

<body>
    <div class="nav">
        <a href="#"><img src="images/logo.png" width="130" height="48"></a>
        <ul>
            <li><a href="/query/manager"><span class="fas font">&#xf21b;</span>管理员入口</a></li>
            <li><a href="/query/user/search"><span class="fas font">&#xf7f2;</span>我的问卷</a></li>
            <li>
                <div class="usr">
                    <span class="fas font">&#xf508;</span>${user.userName}
                    <div class="choice">
                        <span class="fas font"><a href="/query/user">&#xf02d;用户信息</a></span>
                        <p class="line"></p>
                        <span class="fas font"><a href="/query/logout">&#xf14d;退出登录</a></span>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <div>
        <div class="menu">
            <span><a href="/query/user/addQuery">+创建问卷</a></span>
            <span class="fas font"><a href="/query/user/search">&#xf002;&nbsp;&nbsp;搜索问卷</a></span>
            <span class="fas font"><a href="/query/user/updatePassword">&#xf084;&nbsp;&nbsp;修改密码</a></span>
            <span class="fas font"><a href="/query/user">&#xf2c2;&nbsp;&nbsp;用户信息</a></span>
            <span class="fas font"><a href="/query/logout">&#xf14d;&nbsp;&nbsp;退出登录</a></span>
        </div>
        <div class="content">
            <div class="title">
                <span class="fas font">&#xf059;&nbsp;&nbsp;题目列表&nbsp;&nbsp;</span>
                <input type="button" name="delete" value="查看调查结果" class="btn btn-primary" onclick="result()">
            </div>
            <p class="line"></p>
            <div class="query">
                <c:forEach items="${questionList}" var="question">
                    <c:choose>
                        <c:when test="${question.type eq 1 }">
                            <div>
                                <p>${question.orderNumber}.单选题:${question.description}</p>
                                <p>选项A:${question.choiceA}</p>
                                <p>选项B:${question.choiceB}</p>
                                <p>选项C:${question.choiceC}</p>
                                <p>选项D:${question.choiceD}</p>
                            </div>
                        </c:when>
                        <c:when test="${question.type eq 2 }">
                            <div>
                                <p>${question.orderNumber}.多选题:${question.description}</p>
                                <p>选项A:${question.choiceA}</p>
                                <p>选项B:${question.choiceB}</p>
                                <p>选项C:${question.choiceC}</p>
                                <p>选项D:${question.choiceD}</p>
                            </div>
                        </c:when>
                        <c:otherwise>
                            <div>
                                <p>${question.orderNumber}.问答题:${question.description}</p>
                            </div>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
                <p class="line"></p>
            </div>
        </div>
    </div>
</body>
<script>
    function result() {
        location.href = "/query/paper/result/${questionList[0].questionnaireId}";
    }
</script>

</html>